package main

import (
	"fmt"
	"time"
)

func main() {

	fmt.Println(calcDegradeToLevel(3))

	period, _ := time.Parse("20060102", "20230721")
	period = time.Date(period.Year(), period.Month()+1, 1, 0, 0, 0, 0, period.Location())

	fmt.Print(period.Format("2006-01-02 15:04:05"))
}

func calcDegradeToLevel(originLevel uint32) uint32 {
	switch originLevel {
	case 4, 5, 6:
		return 3
	case 3:
		return 2
	case 2:
		return 1
	default:
		return originLevel //其他等级不变
	}
}
